/* eslint-disable max-classes-per-file */
import { JsonProperty, Serializable } from '@/plugins/reflect-metadata';

import { WithdrawStatusType } from '../const';
import WithdrawItem from './WithdrawItem';

@Serializable()
export class WithdrawQuery {
  @JsonProperty('pageNum')
    pageNum: number = 1;

  @JsonProperty('pageSize')
    pageSize: number = 10;

  @JsonProperty('status')
    status: number = WithdrawStatusType.成功;

  get params() {
    return {
      pageNum: this.pageNum,
      pageSize: this.pageSize,
      status: this.status,
    };
  }
}

@Serializable()
export default class WithdrawList {
  @JsonProperty({ name: 'rows', type: WithdrawItem })
    items: WithdrawItem[] = [];

  @JsonProperty('total')
    total: number = 0;
}
